<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    class Single {
        static _instance = null

        constructor(name, age) {
            if (!Single._instance && !(Single._instance instanceof Single)) {
                this.name = name
                this.age = age
                Single._instance = this
            }
            return Single._instance
        }
    }

    console.log(new Single('world', 22));
    console.log(new Single('hello', 18));
</script>
</body>
</html>
